import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { UserComponent } from './user.component';
import {
  UserCertificateReissueComponent,
  UserUIMComponent,
  UserCertificateRenewComponent,
  UserCompanyChangeComponent,
  UserExamRegisterComponent
} from './apply';
import { PublishUserComponent } from './publish';
import { UserCertManComponent } from './info-record';
import { ChangePassComponent } from "../../theme/components";

// noinspection TypeScriptValidateTypes
const routes: Routes = [
  {
    path: '',
    component: UserComponent,
    children: [
      { path: '', redirectTo: 'apply/ea', pathMatch: 'full' },
      { path: 'dashboard', loadChildren: () => System.import('../dashboard/dashboard.module') },
      {
        path: 'apply/ea',
        component: UserExamRegisterComponent
      },
      {
        path: 'apply/cr',
        component: UserCertificateRenewComponent
      },
      {
        path: 'apply/cc',
        component: UserCompanyChangeComponent
      },
      {
        path: 'apply/um',
        component: UserUIMComponent
      },
      {
        path: 'apply/ci',
        component: UserCertificateReissueComponent
      },
      {
        path: 'record/publish',
        component: PublishUserComponent
      },
      {
        path: 'record/cm',
        component: UserCertManComponent
      },
      {
        path: 'changepass',
        component: ChangePassComponent
      }
    ]
  }
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class UserRoutingModule { }
